﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using nplJobsCommon.Common;
using nplJobsDAL;
using System.Data;
using System.Data.SqlClient;

namespace nplJobsDAL.Common
{
    public  class JobTitleDAL:DataAccessBase
    {
        public  DataTable GetList(int categoryID)
        {
            try
            {                

                DataSet ds;
                DataBaseHelper dbHelper = new DataBaseHelper("spJobTitle");

                SqlParameter prm = new SqlParameter("@JobCategoryID", SqlDbType.Int);
                prm.Value = categoryID;
                
                SqlParameter[] prmCollection = { prm };

                dbHelper.Parameters = prmCollection;                
    
                ds = dbHelper.Run(base.ConnectionString, dbHelper.Parameters);
                return ds.Tables[0];
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
    }
}
